#pragma GCC optimize(2)
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <vector>

using namespace std;
using LL = long long;
const int N = 2e5 + 10;

int n, q;
LL num[N];
LL sum = 0;
LL minv = 0, maxv = 0;


int query(int j){
    int l = 1, r = n;
    while(l < r){
        int mid = l + r >> 1;
        if((sum + mid - 1) / mid > j){
            l = mid + 1;
        }else{
            r = mid;
        }
    }
    return r;
}

int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);

    scanf("%d", &n);
    
    for(int i = 1; i <= n; i ++){
        scanf("%lld", &num[i]);
        sum += num[i];
        minv = max(minv, (sum + i - 1) / i);
    }
    maxv = sum;

    scanf("%d", &q);
    while(q--){
        LL j;
        scanf("%lld", &j);
        if(j < minv ){
            printf("-1\n");
        }else{
            printf("%d\n", query(j));
        }
    }


    return 0;
}